package com.design.model;

/**
 * 建造者模式示例
 *
 * @author lw
 * @date 2023/12/1 14:41
 **/
public class BuilderPatternExample {

    public static void main(String[] args) {
        HouseBuilder builder1 = new ConcreteHouseBuilder();
        Director director1 = new Director(builder1);
        House house1 = director1.constructHouse();
        System.out.println("house1.toString() = " + house1.toString());

        HouseBuilder builder2 = new LuxuryHouseBuilder();
        Director director2 = new Director(builder2);
        House house2 = director2.constructHouse();
        System.out.println("house2.toString() = " + house2.toString());
    }
}
